package com.inspur.edp.team.rest;

import com.inspur.edp.team.PaasTeamService;
import com.inspur.edp.team.dto.Team;
import io.iec.edp.caf.commons.utils.SpringBeanUtils;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.util.List;

/**
 * 开发团队restful接口
 */
@Path("/")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class TeamController {

    private PaasTeamService paasTeamService = SpringBeanUtils.getBean(PaasTeamService.class);
    /**
     * 创建团队-含控制点
     *
     * @param team
     * @
     */
    @POST
    @Path(value = "/addteam")
    public void addTeam(Team team) {
        paasTeamService.addTeam(team);
    }

    /**
     * 更新团队信息
     *
     * @param team
     * @
     */
    @POST
    @Path(value = "/updateteam")
    public void updateTeam(Team team) {
        paasTeamService.updateTeam(team);
    }


    /**
     * 获取团队列表-含控制点
     *
     * @return
     * @
     */
    @GET
    @Path(value = "/teamlist")
    public List<Team> getTeam() {
        return paasTeamService.getTeam();
    }

    /**
     * 获取所有团队列表
     *
     * @return
     * @
     */
    @GET
    @Path(value = "/allteamlist")
    public List<Team> getAllTeam() {
        return paasTeamService.getAllTeam();
    }

}
